package com.hqyj.lx.service.impl;

import com.hqyj.lx.dao.ExampaperDao;
import com.hqyj.lx.pojo.Exampaper;
import com.hqyj.lx.service.ExampaperService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
/*
* 试卷管理
* */
@Service
public class ExampaperServiceImpl implements ExampaperService {
//    自动装配exampaperDao
    @Autowired
    private ExampaperDao exampaperDao;
//  全查试卷
    @Override
    public List<Exampaper> queryAll() {
        List<Exampaper> exampapers = exampaperDao.queryAll();
        return exampapers;
    }
//  增加试卷
    @Override
    public int insertOne(Exampaper exampaper) {
        int i = exampaperDao.insertOne(exampaper);
        return i;
    }
//删除试卷
    @Override
    public int deleteExampaper(int eId) {
        int i = exampaperDao.deleteExampaper(eId);
        return i;
    }
//修改试卷
    @Override
    public int updateExampaper(Exampaper exampaper) {
        return exampaperDao.updateExampaper(exampaper);
    }
//通过id查询试卷
    @Override
    public Exampaper queryById(int eId) {
        return exampaperDao.queryById(eId);
    }
}
